$(function(){
//	location
var test1=new Vcity.CitySelector({input:'uplocation'});
var test2=new Vcity.CitySelector({input:'downlocation'});

//banner_menuList
$('.banner_menuList .back').on('click',function(){
	console.log($('.banner_leftMenu').css('left'))
if($('.banner_leftMenu').css('left')=='0px'){
	$('.banner_leftMenu').css("left",'calc(-950px + 60px)');
	return;//	location
var test1=new Vcity.CitySelector({input:'uplocation'});
var test2=new Vcity.CitySelector({input:'downlocation'});

}
if($('.banner_leftMenu').css('left')!='0px'){
	$('.banner_leftMenu').css("left",'0px');
	return;
}
});

	$('.banner').on('mouseenter',function(){
		$('.menu'+outIndex).removeClass('show');
	})
	
	var swiper1 = new Swiper('#banner', {
        pagination: '#banner_pagination',
        paginationClickable: '#banner_pagination',
        nextButton: '#right',
        prevButton: '#left',
//      spaceBetween: 30,
        effect: 'fade',
        loop:true,
        autoplay:3000,
        speed:1000,
        lazyLoading : true,
    });

    var swiper2 = new Swiper('#airmsg', {
        slidesPerView: 3,
        slidesPerGroup : 3,
        paginationClickable: true,
       	autoplay : 2500,
    });
 
    $('.link_box>ul>li').hover(function(){
    	$(this).addClass('link_select').removeClass('link_noselect');
    },
    function(){
    	$(this).addClass('link_noselect').removeClass('link_select');
    });
    
    $('.lamp').liMarquee();
    
//  icheck
  $('.sailType input[type="radio"]').iCheck({
    checkboxClass: 'icheckbox_futurico',
    radioClass: 'iradio_futurico',
    increaseArea: '20%' // optional
  });
   $('.mustToday input[type="radio"]').iCheck({
    checkboxClass: 'icheckbox_futurico',
    radioClass: 'iradio_futurico',
    increaseArea: '20%' // optional
  });
 
//tran
   $('.route .tran').on('click',function(){
   		var $next=$(this).next().find('input').val();
   		$(this).next().find('input').val($(this).prev().find('input').val());
   		$(this).prev().find('input').val($next);
   });
// time
	var newTime=(new Date()).valueOf();
	laydate.render({
		elem: '#formdate',
		range: '~',
		calendar: true,
		theme: '#2e91b8',
		min:newTime,
		ready:function(date){
			$('#formdate').attr('maxlength',10)
			$('layui-laydate-content table').on('click',function(){
		alert($(this).find('.layui-this').text())
	})
		},
		done:function(value, date, endDate){
//			console.log(value.substring(0,10))
			
//			$('#formdate').val('    ');
//			console.log(value);
		console.log($('#formdate').val())
			$('#todate').val(endDate.year+'-'+endDate.month+'-'+endDate.date);
		},

	});
	laydate.render({
		elem: '#todate' ,
		range: '~',
		calendar: true,
		theme: '#2e91b8',
	});
	
	$('#formdate').on('change',function(){
		alert($('#formdate').val());
	})
	
	
	//number
	if($('.input-group .short-input input[type="text"]').val()==undefined){
		$('.input-group .short-input input[type="text"]').val(0);	
	}
	var $adults=parseInt($(this).parent().prev().val());
	if($adults==NaN){
	}
	$('.inputBox .control .add').on('click',function(){
		let $adults=parseInt($(this).parent().prev().val());
		alert($adults)
	})
});
